Re: basic questions: Postgres with yum on CentOS 5.1
От | Chuck |
---|---|
Тема | Re: basic questions: Postgres with yum on CentOS 5.1 |
Дата | |
Msg-id | p0623095ec3a0a6a279c1@[192.168.1.50] обсуждение исходный текст |
Ответ на | Re: basic questions: Postgres with yum on CentOS 5.1 (Andrew Sullivan <ajs@crankycanuck.ca>) |
Ответы |
Re: basic questions: Postgres with yum on CentOS 5.1
("Joshua D. Drake" <jd@commandprompt.com>)
Re: basic questions: Postgres with yum on CentOS 5.1 (Greg Smith <gsmith@gregsmith.com>) Re: basic questions: Postgres with yum on CentOS 5.1 (Andrew Sullivan <ajs@crankycanuck.ca>) Re: basic questions: Postgres with yum on CentOS 5.1 (Tomasz Ostrowski <tometzky@batory.org.pl>) |
Список | pgsql-general |
Thanks for Tomasz and Andrew's responses (as well as one person's response off the list). There was a lot of valuable information. I've done some further reading in the postgres manual and I've exchanged a few emails from my web host. My web host recommends sticking with the CentOS repo packages for simplicities sake. They said that I can use "yum update postgres postgres-devel postgres-server" to upgrade when they release the new version. This sounds fine to me. I'm not sure how to "make sure automatic updates are turned on" as Tometzky recommended. Is that a yum setting? Since I have root access, I believe that I should open a root shell use a commands like this: sudo -u postgres createdb myDB ### background: Since I have a packaged installation, I don't believe that I will call initdb directly. I believe the following commands the proper way to start and stop my database server: #start server service postgresql start #stop server service postgresql stop I executed 'service postgresql start' and got the following output: [root@vs191 ~]# service postgresql start Initializing database: [ OK ] Starting postgresql service: [ OK ] When I listed the current databases, I found out that UTF-8 is not being used. [root@vs191 ~]# sudo -u postgres psql -l could not change directory to "/root" List of databases Name | Owner | Encoding -----------+----------+----------- postgres | postgres | SQL_ASCII template0 | postgres | SQL_ASCII template1 | postgres | SQL_ASCII (3 rows) I created a test database and confirmed that it's created with 'SQL_ASCII' encoding. [root@vs191 ~]# sudo -u postgres createdb myTest could not change directory to "/root" CREATE DATABASE [root@vs191 ~]# sudo -u postgres psql -l could not change directory to "/root" List of databases Name | Owner | Encoding -----------+----------+----------- myTest | postgres | SQL_ASCII postgres | postgres | SQL_ASCII template0 | postgres | SQL_ASCII template1 | postgres | SQL_ASCII (4 rows) I found the installation location: /var/lib/pgsql/ ### more info: I need to store multiple languages in my database such as English, French and Japanese. The end of the "21.2.2. Setting the Character Set" section says, "One way to use multiple encodings safely is to set the locale to C or POSIX during initdb, thus disabling any real locale awareness." http://www.postgresql.org/docs/8.1/interactive/multibyte.html Without a package manager, I believe that this would be my initdb command: sudo -u postgres initdb -D /var/lib/pgsql/data -E UTF8 --no-locale I found the '--no-locale' option from 'initdb --help' and from this link: http://docs.planetargon.com/PostgreSQL_Installation I couldn't find the '--no-locale' option in the documentation. ### main question: I think that need to figure where initdb is being called from to modify its parameters. Or, I need to determine how to set the default encoding to be UTF8. This might be more of a yum package question. Thanks for your help, Chuck
В списке pgsql-general по дате отправления:
Следующее
От: "Joshua D. Drake"Дата:
Сообщение: Re: basic questions: Postgres with yum on CentOS 5.1